|
ARD2
1.00 for Rev B. Hardware
Airbag Reference Demonstrator using MPC5604P
|
State machine basic functionality. More...
#include "derivative.h"#include "compile_options.h"#include "HAL.h"#include "SM.h"#include "Application_Globals.h"Functions | |
| uint32_t | u32fnSMLaunch (void) |
| Launches the State Machine and loops forever from one state to the next. | |
| void | vfnSMWriteNextState (uint16_t u16NextState) |
| Writes the next state to gu16SMCurrentState[1]; Keeps the past state as the current one to gu16SMCurrentState[0]. | |
| uint32_t | u32fnSMValidateCurrentState (uint16_t *pu16ValidStateList, uint16_t u16Size) |
| Function used in each state to validate if the reason we got here is valid. | |
Variables | |
| uint32_t(*const | u32pfnState [])(void) |
| uint16_t | gu16SMCurrentState [2u] |
| uint32_t | gu32SMStateStatus |
State machine basic functionality.
Copyright (C) 2011 Freescale Semiconductor Freescale Confidential Proprietary
History:
| uint32_t u32fnSMLaunch | ( | void | ) |
Launches the State Machine and loops forever from one state to the next.
| None |
| uint32_t u32fnSMValidateCurrentState | ( | uint16_t * | pu16ValidStateList, |
| uint16_t | u16Size | ||
| ) |
Function used in each state to validate if the reason we got here is valid.
| pu16ValidStateList,: | a pointer to an array with a list of valid source states. |
| u16Size,: | Size of the table in pu16ValidStateList. |
| void vfnSMWriteNextState | ( | uint16_t | u16NextState | ) |
Writes the next state to gu16SMCurrentState[1]; Keeps the past state as the current one to gu16SMCurrentState[0].
| u16NextState,: | the index to the next state. |
| uint16_t gu16SMCurrentState[2u] |
Array that holds the current state, and the previous one as well. Previous state is held in position 0, current state is held in position 1.
| uint32_t gu32SMStateStatus |
Global state for the state machine
| uint32_t(* const u32pfnState[])(void) |
{
&u32fnSMAppInit, &u32fnStateError, &u32fnStateAcquisition,
&u32fnStateDecision, &u32fnStateDeployment, &u32fnStateSystemTest,
&u32fnStateGUI}
The element below is a constant array of pointers to functions where